<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>文件上传</title>
</head>
<body>
    <h1>我是文件上传1</h1>

    <form action="/upload/file" id="uploadFrom" enctype="multipart/form-data" method="post">
        <input name="dir" type="bbs" id="filedir">
        <input name="file" type="file" onchange="toupload()">
    </form>
        <script>
            function toupload(){
                document.getElementById("uploadFrom").submit();
            }
        </script>
</body>
</html>